public class Main {

	public static void main(String[] args) {

		String pserialized = "geometry.Point;String:6:Point1;double:1.0;double:2.0;";
		Point p = (Point) Point.deserialize(pserialized);
		System.out.println("x=" + p.getX() + ",y=" + p.getY() + ", name="
				+ p.getName());

		String sserialized = "String:8:Segment1;geometry.Point;String:6:Point1;double:1.0;double:2.0;geometry.Point;String:6:Point2;double:2.0;double:3.0;;";
		Segment s = (Segment) Segment.deserialize(sserialized);
		System.out.println(s);

		String pcserialized = "String:11:ColorPoint1;double:1.0;double:2.0;String:6:Fushia";

		ColorPoint pc = (ColorPoint) ColorPoint.deserialize(pcserialized);
		System.out.println(pc);
	}
}
